class Solution {
public:
    bool isVowel(char c)
    {
        string vowels = "aeiouAEIOU";
        for (int i = 0; i < vowels.length(); i++) {
            if (vowels[i] == c)
                return true;
        }
        return false;
    }
    string reverseVowels(string s)
    {
        char temp;
        for (int low = 0, high = s.length() - 1; low <= high; low++, high--) {
            while (low < high && !isVowel(s[low])) {
                low++;
            }
            temp = s[low];
            while (low < high && !isVowel(s[high])) {
                high--;
            }
            s[low] = s[high];
            s[high] = temp;
        }
        return s;
    }
};